#pragma once
#include "HSModelAPI.h"
#include "ICustomModelRenderable.h"
#include <memory>
#include <set>

class Model3D;

typedef std::pair<size_t, size_t> THMapPoint;

/** 
*  Struct representing an area in HeightMap coordinates
*  points: std::set<THMapPoint>
*  level: double
*/
struct THMapArea
  {
  std::set<THMapPoint> points;
  double level;
  };

class Water : public ICustomModelRenderable
  {
  public:
    HSMODEL_API Water(const TVector3 i_position, THMapArea i_area, std::shared_ptr<Model3D> i_model);

    HSMODEL_API std::string GetName() const;
    HSMODEL_API TVector3 GetPosition() const;

    HSMODEL_API Model3D& GetModel();
    HSMODEL_API const Model3D& GetModel() const;

    HSMODEL_API const THMapArea& GetArea() const;

  private:
    TVector3 m_position;
    THMapArea m_area;
    std::shared_ptr<Model3D> m_model;
    size_t m_id;

    static size_t mg_waters_id;
  };